# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Kyle Keen <keenerd@gmail.com>

_pyname=jupyter_console
pkgname=${_pyname/_/-}
pkgver=6.6.3
pkgrel=2
pkgdesc='An IPython-like terminal frontend for Jupyter kernels in any language'
arch=(any)
url='https://pypi.org/project/jupyter_console/'
license=(BSD)
depends=(python-jupyter-client)
makedepends=(python-build python-installer python-hatchling)
checkdepends=(python-pytest python-flaky)
conflicts=(jupyter_console)
provides=(jupyter_console)
replaces=(jupyter_console)
source=(https://pypi.python.org/packages/source/${_pyname:0:1}/$_pyname/$_pyname-$pkgver.tar.gz)
sha256sums=('566a4bf31c87adbfadf22cdf846e3069b59a71ed5da71d6ba4d8aaad14a53539')

build() {
  cd $_pyname-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd $_pyname-$pkgver
  pytest -v
}

package() {
  cd $_pyname-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  rm -r "$pkgdir"/usr/lib/python*/site-packages/$_pyname/tests
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
}
